#ifndef IGAMEOBJECT_H
#define IGAMEOBJECT_H

/*
IGameObject virtual base class for most game objects.
*/


//#include <irrlicht.h>
#include "IReferenceCounted.h"
#include "IGameProperty.h"

using namespace irr;
//using namespace MarCore;


namespace MarCore
{

typedef irr::core::array<class IGameObject> CGameObjectArray;
typedef irr::core::array<class IGameProperty> CGamePropertyArray;

class IGameObject : public IReferenceCounted
{

    CGamePropertyArray* properties;

    //! Official IGameObject register deriviation id number.
    static const int goid =0x00000000;

    //! Position of stroke
    bool strokeP;

    //! The rod pushes this object...
    IGameObject* rod;

    //! ...this pushes its cranks.
    /*CGameObjectArray**/ CGameObjectArray* crank;

public:

    //! Default constructor
    IGameObject();

    //! Constructor
    IGameObject( IGameObject* rod_, CGameObjectArray* crank_ );

    //! Copy constructor
    IGameObject( IGameObject* object ):
    rod( object->rod ), crank( object->crank ) {};

    //! Destructor
    virtual ~IGameObject() =0;

    //! Sets the parent 'rod'
    virtual void setRod( IGameObject* new_rod ) =0;

    //! Adds a child 'crank'
    virtual void addCrank( const IGameObject& new_crank ) =0;

    //! Run logic tik.
    virtual void stroke() =0;

};

#endif // IGAMEOBJECT_H
